home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
t1pascal.exe
/
SETS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-05-25
|
2KB
|
50 lines
PROGRAM define_some_sets;
TYPE goodies = (ice_cream,whipped_cream,banana,nuts,cherry,
choc_syrup,strawberries,caramel,soda_water,
salt,pepper,cone,straw,spoon,stick);
treat = SET OF goodies;
VAR sundae : treat;
banana_split : treat;
soda : treat;
ice_cream_cone : treat;
nutty_buddy : treat;
mixed : treat;
index : BYTE;
BEGIN
(* define all ingredients used in each treat *)
ice_cream_cone := [ice_cream,cone];
soda := [straw,soda_water,ice_cream,cherry];
banana_split := [ice_cream..caramel];
banana_split := banana_split + [spoon];
nutty_buddy := [cone,ice_cream,choc_syrup,nuts];
sundae := [ice_cream,whipped_cream,nuts,cherry,choc_syrup,
spoon];
(* combine for a list of all ingredients used *)
mixed := ice_cream_cone + soda + banana_split + nutty_buddy +
sundae;
mixed := [ice_cream..stick] - mixed; (* all ingredients not used *)
IF ice_cream IN mixed THEN WRITELN('Ice cream not used');
IF whipped_cream IN mixed THEN WRITELN('Whipped cream not used');
IF banana IN mixed THEN WRITELN('Bananas not used');
IF nuts IN mixed THEN WRITELN('Nuts are not used');
IF cherry IN mixed THEN WRITELN('Cherrys not used');
IF choc_syrup IN mixed THEN WRITELN('Chocolate syrup not used');
IF strawberries IN mixed THEN WRITELN('Strawberries not used');
IF caramel IN mixed THEN WRITELN('Caramel is not used');
IF soda_water IN mixed THEN WRITELN('Soda water is not used');
IF salt IN mixed THEN WRITELN('Salt not used');
IF pepper IN mixed THEN WRITELN('Pepper not used');
IF cone IN mixed THEN WRITELN('Cone not used');
IF straw IN mixed THEN WRITELN('Straw not used');
IF spoon IN mixed THEN WRITELN('Spoon not used');
IF stick IN mixed THEN WRITELN('Stick not used');
END.